# $Id$
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Firmicus <francois.archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=gsfonts
pkgver=20170829
pkgrel=1
pkgdesc='(URW)++ Core Font Set [Level 2]'
url='https://github.com/ArtifexSoftware/urw-base35-fonts'
arch=('any')
license=('AGPL3')
makedepends=('git')
_commit=b1605de3323b42ca3fae7aea3bf2dd72aa2cd490  # master
source=("git+https://github.com/ArtifexSoftware/urw-base35-fonts#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
	cd urw-base35-fonts
	echo $(TZ=UTC git show -s --pretty=%cd --date=format-local:%Y%m%d HEAD)
}

package() {
	cd urw-base35-fonts
	install -Dt "${pkgdir}/usr/share/fonts/${pkgname}" -m644 fonts/*.otf
	install -Dt "${pkgdir}/usr/share/appdata" -m644 appstream/*.xml

	install -d "${pkgdir}"/etc/fonts/conf.{avail,d}
	for _f in fontconfig/*.conf; do
		_fn="${pkgdir}/etc/fonts/conf.avail/69-${_f##*/}"
		install -m644 ${_f} "${_fn}"
		ln -srt "${pkgdir}/etc/fonts/conf.d" "${_fn}"
	done
}
